# coding=utf-8
# author:xc
# datetime:2018/8/1 8:08

import sys

sys.path.append('/home/www/education/venv/lib64/python2.7/site-packages')
sys.path.append('/usr/lib64/python2.7')
sys.path.append('/usr/lib64/python2.7/site-packages')
from flask import Flask
import redis
PAGE_NUM = 12

pool = redis.ConnectionPool(host='127.0.0.1', port='6379', db=3)
redis = redis.Redis(connection_pool=pool)
import common
common.set_machine_conf()


def create_app():
    app = Flask(__name__)

    from .api import api as apis_blueprint
    app.register_blueprint(apis_blueprint)

    from .admin import admin as admin_blueprint
    app.register_blueprint(admin_blueprint)

    from .pay import pay as pay_blueprint
    app.register_blueprint(pay_blueprint)
    
    from .business import business as business_blueprint
    app.register_blueprint(business_blueprint)

    return app

